<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>NGUI: Next-Gen UI kit: BetterList&lt; T &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">NGUI: Next-Gen UI kit
   &#160;<span id="projectnumber">3.7.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_better_list_3_01_t_01_4.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Properties</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="class_better_list_3_01_t_01_4-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">BetterList&lt; T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>This improved version of the System.Collections.Generic.List that doesn't release the buffer on <a class="el" href="class_better_list_3_01_t_01_4.html#a3fe73e26e4af6730ad5c51262b8defc6" title="Clear the array by resetting its size to zero. Note that the memory is not actually released...">Clear()</a>, resulting in better performance and less garbage collection. PRO: BetterList performs faster than List when you Add and Remove items (although slower if you remove from the beginning). CON: BetterList performs worse when sorting the list. If your operations involve sorting, use the standard List instead.  
 <a href="class_better_list_3_01_t_01_4.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a85bc21502d4505f8b3081fad50bc938b"><td class="memItemLeft" align="right" valign="top">IEnumerator&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a85bc21502d4505f8b3081fad50bc938b">GetEnumerator</a> ()</td></tr>
<tr class="memdesc:a85bc21502d4505f8b3081fad50bc938b"><td class="mdescLeft">&#160;</td><td class="mdescRight">For 'foreach' functionality.  <a href="#a85bc21502d4505f8b3081fad50bc938b">More...</a><br /></td></tr>
<tr class="separator:a85bc21502d4505f8b3081fad50bc938b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fe73e26e4af6730ad5c51262b8defc6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a3fe73e26e4af6730ad5c51262b8defc6">Clear</a> ()</td></tr>
<tr class="memdesc:a3fe73e26e4af6730ad5c51262b8defc6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the array by resetting its size to zero. Note that the memory is not actually released.  <a href="#a3fe73e26e4af6730ad5c51262b8defc6">More...</a><br /></td></tr>
<tr class="separator:a3fe73e26e4af6730ad5c51262b8defc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15fe71a084201e82909cd79523e1110f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a15fe71a084201e82909cd79523e1110f">Release</a> ()</td></tr>
<tr class="memdesc:a15fe71a084201e82909cd79523e1110f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the array and release the used memory.  <a href="#a15fe71a084201e82909cd79523e1110f">More...</a><br /></td></tr>
<tr class="separator:a15fe71a084201e82909cd79523e1110f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80ef1199bad5ed9aa45feaa0e1fec747"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a80ef1199bad5ed9aa45feaa0e1fec747">Add</a> (T item)</td></tr>
<tr class="memdesc:a80ef1199bad5ed9aa45feaa0e1fec747"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add the specified item to the end of the list.  <a href="#a80ef1199bad5ed9aa45feaa0e1fec747">More...</a><br /></td></tr>
<tr class="separator:a80ef1199bad5ed9aa45feaa0e1fec747"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9665bea744199b01ce7eb6761ecf1747"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a9665bea744199b01ce7eb6761ecf1747">Insert</a> (int index, T item)</td></tr>
<tr class="memdesc:a9665bea744199b01ce7eb6761ecf1747"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert an item at the specified index, pushing the entries back.  <a href="#a9665bea744199b01ce7eb6761ecf1747">More...</a><br /></td></tr>
<tr class="separator:a9665bea744199b01ce7eb6761ecf1747"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae385b11c6da4ab97c48b8b9d7a6fb050"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#ae385b11c6da4ab97c48b8b9d7a6fb050">Contains</a> (T item)</td></tr>
<tr class="memdesc:ae385b11c6da4ab97c48b8b9d7a6fb050"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns 'true' if the specified item is within the list.  <a href="#ae385b11c6da4ab97c48b8b9d7a6fb050">More...</a><br /></td></tr>
<tr class="separator:ae385b11c6da4ab97c48b8b9d7a6fb050"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c2c9ca9d448ca50e038006b0346327d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a2c2c9ca9d448ca50e038006b0346327d">IndexOf</a> (T item)</td></tr>
<tr class="memdesc:a2c2c9ca9d448ca50e038006b0346327d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the index of the specified item.  <a href="#a2c2c9ca9d448ca50e038006b0346327d">More...</a><br /></td></tr>
<tr class="separator:a2c2c9ca9d448ca50e038006b0346327d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a185beecfbce4fa548b74c180b625faf9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a185beecfbce4fa548b74c180b625faf9">Remove</a> (T item)</td></tr>
<tr class="memdesc:a185beecfbce4fa548b74c180b625faf9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove the specified item from the list. Note that <a class="el" href="class_better_list_3_01_t_01_4.html#afe8681eb054a8ba3a960c5d93d8ef21d" title="Remove an item at the specified index. ">RemoveAt()</a> is faster and is advisable if you already know the index.  <a href="#a185beecfbce4fa548b74c180b625faf9">More...</a><br /></td></tr>
<tr class="separator:a185beecfbce4fa548b74c180b625faf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe8681eb054a8ba3a960c5d93d8ef21d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#afe8681eb054a8ba3a960c5d93d8ef21d">RemoveAt</a> (int index)</td></tr>
<tr class="memdesc:afe8681eb054a8ba3a960c5d93d8ef21d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove an item at the specified index.  <a href="#afe8681eb054a8ba3a960c5d93d8ef21d">More...</a><br /></td></tr>
<tr class="separator:afe8681eb054a8ba3a960c5d93d8ef21d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dd41337b476d0a0dace55598fd09482"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a7dd41337b476d0a0dace55598fd09482">Pop</a> ()</td></tr>
<tr class="memdesc:a7dd41337b476d0a0dace55598fd09482"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove an item from the end.  <a href="#a7dd41337b476d0a0dace55598fd09482">More...</a><br /></td></tr>
<tr class="separator:a7dd41337b476d0a0dace55598fd09482"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a035cfb5d65fb26a43dbb006930410830"><td class="memItemLeft" align="right" valign="top">T[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a035cfb5d65fb26a43dbb006930410830">ToArray</a> ()</td></tr>
<tr class="memdesc:a035cfb5d65fb26a43dbb006930410830"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mimic List's <a class="el" href="class_better_list_3_01_t_01_4.html#a035cfb5d65fb26a43dbb006930410830" title="Mimic List&#39;s ToArray() functionality, except that in this case the list is resized to match the curre...">ToArray()</a> functionality, except that in this case the list is resized to match the current size.  <a href="#a035cfb5d65fb26a43dbb006930410830">More...</a><br /></td></tr>
<tr class="separator:a035cfb5d65fb26a43dbb006930410830"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab26a7a392e7453c327924d100691e358"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#ab26a7a392e7453c327924d100691e358">Sort</a> (<a class="el" href="class_better_list_3_01_t_01_4.html#a3856de73e62e04be0562d80b9029a2e4">CompareFunc</a> comparer)</td></tr>
<tr class="memdesc:ab26a7a392e7453c327924d100691e358"><td class="mdescLeft">&#160;</td><td class="mdescRight">List.Sort equivalent. Doing Array.Sort causes GC allocations.  <a href="#ab26a7a392e7453c327924d100691e358">More...</a><br /></td></tr>
<tr class="separator:ab26a7a392e7453c327924d100691e358"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3856de73e62e04be0562d80b9029a2e4"><td class="memItemLeft" align="right" valign="top">delegate int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#a3856de73e62e04be0562d80b9029a2e4">CompareFunc</a> (T left, T right)</td></tr>
<tr class="memdesc:a3856de73e62e04be0562d80b9029a2e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Comparison function should return -1 if left is less than right, 1 if left is greater than right, and 0 if they match.  <a href="#a3856de73e62e04be0562d80b9029a2e4">More...</a><br /></td></tr>
<tr class="separator:a3856de73e62e04be0562d80b9029a2e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ae25b374ece91b81ab57b1d4b038ecb1b"><td class="memItemLeft" align="right" valign="top">T[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#ae25b374ece91b81ab57b1d4b038ecb1b">buffer</a></td></tr>
<tr class="memdesc:ae25b374ece91b81ab57b1d4b038ecb1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Direct access to the buffer. Note that you should not use its 'Length' parameter, but instead use BetterList.size.  <a href="#ae25b374ece91b81ab57b1d4b038ecb1b">More...</a><br /></td></tr>
<tr class="separator:ae25b374ece91b81ab57b1d4b038ecb1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade12ac49ce27b37482d8d5830c604e84"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#ade12ac49ce27b37482d8d5830c604e84">size</a> = 0</td></tr>
<tr class="memdesc:ade12ac49ce27b37482d8d5830c604e84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Direct access to the buffer's size. Note that it's only public for speed and efficiency. You shouldn't modify it.  <a href="#ade12ac49ce27b37482d8d5830c604e84">More...</a><br /></td></tr>
<tr class="separator:ade12ac49ce27b37482d8d5830c604e84"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:adf631b621140d5aed1dd46a3c3ecb5aa"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_better_list_3_01_t_01_4.html#adf631b621140d5aed1dd46a3c3ecb5aa">this[int i]</a><code> [get, set]</code></td></tr>
<tr class="memdesc:adf631b621140d5aed1dd46a3c3ecb5aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convenience function. I recommend using .buffer instead.  <a href="#adf631b621140d5aed1dd46a3c3ecb5aa">More...</a><br /></td></tr>
<tr class="separator:adf631b621140d5aed1dd46a3c3ecb5aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This improved version of the System.Collections.Generic.List that doesn't release the buffer on <a class="el" href="class_better_list_3_01_t_01_4.html#a3fe73e26e4af6730ad5c51262b8defc6" title="Clear the array by resetting its size to zero. Note that the memory is not actually released...">Clear()</a>, resulting in better performance and less garbage collection. PRO: BetterList performs faster than List when you Add and Remove items (although slower if you remove from the beginning). CON: BetterList performs worse when sorting the list. If your operations involve sorting, use the standard List instead. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a80ef1199bad5ed9aa45feaa0e1fec747"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BetterList&lt; T &gt;.Add </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add the specified item to the end of the list. </p>

</div>
</div>
<a class="anchor" id="a3fe73e26e4af6730ad5c51262b8defc6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BetterList&lt; T &gt;.Clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear the array by resetting its size to zero. Note that the memory is not actually released. </p>

</div>
</div>
<a class="anchor" id="a3856de73e62e04be0562d80b9029a2e4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">delegate int BetterList&lt; T &gt;.CompareFunc </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>right</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Comparison function should return -1 if left is less than right, 1 if left is greater than right, and 0 if they match. </p>

</div>
</div>
<a class="anchor" id="ae385b11c6da4ab97c48b8b9d7a6fb050"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool BetterList&lt; T &gt;.Contains </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns 'true' if the specified item is within the list. </p>

</div>
</div>
<a class="anchor" id="a85bc21502d4505f8b3081fad50bc938b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">IEnumerator&lt;T&gt; BetterList&lt; T &gt;.GetEnumerator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For 'foreach' functionality. </p>

</div>
</div>
<a class="anchor" id="a2c2c9ca9d448ca50e038006b0346327d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BetterList&lt; T &gt;.IndexOf </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the index of the specified item. </p>

</div>
</div>
<a class="anchor" id="a9665bea744199b01ce7eb6761ecf1747"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BetterList&lt; T &gt;.Insert </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>item</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Insert an item at the specified index, pushing the entries back. </p>

</div>
</div>
<a class="anchor" id="a7dd41337b476d0a0dace55598fd09482"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">T BetterList&lt; T &gt;.Pop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove an item from the end. </p>

</div>
</div>
<a class="anchor" id="a15fe71a084201e82909cd79523e1110f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BetterList&lt; T &gt;.Release </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear the array and release the used memory. </p>

</div>
</div>
<a class="anchor" id="a185beecfbce4fa548b74c180b625faf9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool BetterList&lt; T &gt;.Remove </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove the specified item from the list. Note that <a class="el" href="class_better_list_3_01_t_01_4.html#afe8681eb054a8ba3a960c5d93d8ef21d" title="Remove an item at the specified index. ">RemoveAt()</a> is faster and is advisable if you already know the index. </p>

</div>
</div>
<a class="anchor" id="afe8681eb054a8ba3a960c5d93d8ef21d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BetterList&lt; T &gt;.RemoveAt </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove an item at the specified index. </p>

</div>
</div>
<a class="anchor" id="ab26a7a392e7453c327924d100691e358"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BetterList&lt; T &gt;.Sort </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_better_list_3_01_t_01_4.html#a3856de73e62e04be0562d80b9029a2e4">CompareFunc</a>&#160;</td>
          <td class="paramname"><em>comparer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>List.Sort equivalent. Doing Array.Sort causes GC allocations. </p>
<p>List.Sort equivalent. Manual sorting causes no GC allocations. </p>

</div>
</div>
<a class="anchor" id="a035cfb5d65fb26a43dbb006930410830"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">T [] BetterList&lt; T &gt;.ToArray </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Mimic List's <a class="el" href="class_better_list_3_01_t_01_4.html#a035cfb5d65fb26a43dbb006930410830" title="Mimic List&#39;s ToArray() functionality, except that in this case the list is resized to match the curre...">ToArray()</a> functionality, except that in this case the list is resized to match the current size. </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="ae25b374ece91b81ab57b1d4b038ecb1b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">T [] BetterList&lt; T &gt;.buffer</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Direct access to the buffer. Note that you should not use its 'Length' parameter, but instead use BetterList.size. </p>

</div>
</div>
<a class="anchor" id="ade12ac49ce27b37482d8d5830c604e84"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BetterList&lt; T &gt;.size = 0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Direct access to the buffer's size. Note that it's only public for speed and efficiency. You shouldn't modify it. </p>

</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a class="anchor" id="adf631b621140d5aed1dd46a3c3ecb5aa"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T BetterList&lt; T &gt;.this[int i]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convenience function. I recommend using .buffer instead. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/Projects/NGUI/Assets/NGUI/Scripts/Internal/<a class="el" href="_better_list_8cs.html">BetterList.cs</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_better_list_3_01_t_01_4.html">BetterList< T ></a></li>
    <li class="footer">Generated on Sat Sep 13 2014 05:29:16 for NGUI: Next-Gen UI kit by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.8 </li>
  </ul>
</div>
</body>
</html>
